//定时器
var xiaoshi = document.querySelector('.hour_show');
var fenzhong = document.querySelector('.minute_show');
var miao = document.querySelector('.second_show');
function countdown(dateEnd) {
    const subsidies = (count) => count > 0 ? (count > 9 ? count.toString() : '0' + count) : '00'
    let result = new Date(dateEnd).getTime() - new Date().getTime()
    result = parseInt(result / 1000)
    // console.log(result);
    let d = subsidies(Math.floor(result / (60 * 60 * 24)))
    let h = subsidies(Math.floor(result / (60 * 60 * 1) % 24))
    let m = subsidies(Math.floor(result / (60 * 1) % 60))
    let s = subsidies(Math.floor(result % 60))
    return { d, h, m, s }
}



setInterval(() => {
    showCountdown()
}, 1000)
showCountdown()
function showCountdown() {
    let divs = document.querySelector('#first strong')
    let date = countdown('2023-1-21 00:00:00')
    xiaoshi.innerHTML = date.h
    fenzhong.innerHTML = date.m
    miao.innerHTML = date.s

}
